package com.idea.zd.sys.train.thread.producerandconsumer;

import java.util.LinkedList;
import java.util.Queue;

public class Test {

    public static void main(String [] args) throws InterruptedException {
        Queue<String> queue = new LinkedList<>();

        Producer producer = new Producer(queue);
        Consumer consumer = new Consumer(queue);

        new Thread(producer).start();
        new Thread(consumer).start();

        Thread.currentThread().join();

        for (String s:queue){
            System.out.println(s);
        }

    }
}
